In a CNC machine tool, an NC program corresponding to a work to be machined is created and then a tool and fixing means are used for machining the work with automatic operation, In this regard, when machining is performed for the first time after creation of the NC program or for the first time after exchange of the work or fixing means, it is necessary to interrupt the automatic operation of the machine tool halfway and to perform jobs such as checking precision of the work, checking the tool length, cleaning out cut scraps, checking if the tool is damaged or not, checking the orientation of the nozzle for coolant or the like, so as to prevent errors in machining.
There are two common methods for stopping the automatic operation of a CNC machine tool at a desired position. The first is a method in which M00 (program stop) and M01 (optional stop) are used. For this method, M codes as M01 or M02 must be set at the desired stop position of the NC program. According to this, it is inevitable to change the position at which the M codes are set in the created NC program in order to change the position at which the automatic operation of the machine tool is stopped.
The second is a method in which the function of “Sequence Number Comparison and Stop” is used. In this method, the program number and sequence number, at which the automatic operation is desired to be stopped, are registered beforehand apart from the NC program.
By arranging in such a manner, automatic operation with the NC program is executed, the executed NC program comes to match the program number registered beforehand and then automatic operation of the machine tool can be stopped when the action by the block of the sequence number registered beforehand has been completed.
The aforementioned second method is more advantageous than the first method in that it is not necessary to change the NC program in order to change the position at which the automatic operation of the machine tool is stopped. However, the second method has two restrictions. The first restriction is such that only one position can be set in the NC program as the position at which the automatic operation is stopped. Even if the automatic operation of the machine tool is desired to be stopped at plurality of positions, there is no way to do this. The second restriction is such that there are blocks without sequence number in the NC program and the automatic operation of the machine tool can not be stopped at the block without sequence number.
Further, there is another, that is, the third method, which corresponds to the numerically controlling apparatus disclosed in U.S. Pat. No. 7,110,851 (patent document 1). In the numerically controlling apparatus disclosed in the patent document 1, an operator sets specific T codes or G codes, as codes for stopping the automatic operation of the machine tool, using a keyboard. When the action due to the command by the specific T codes or G codes has been completed in the course of the automatic operation by the NC program, the automatic operation of the machine tool is stopped, so that need for changing the NC program is eliminated.
However, in the aforementioned third method, the automatic operation of the machine tool can not be stopped at the block which does not contain T codes or G codes. Further in the third method, the automatic operation of the machine tool is necessarily stopped at the block with the specific T codes or G codes and so the automatic operation is stopped at the block for which there is no need for stopping the automatic operation, thus efficiency of operation being lowered.